package com.zhekou.util;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

/**
 * Created by IntelliJ IDEA.
 * User: Unicorn3964
 * Date: 11-8-3
 * Time: 上午10:27
 * To change this template use File | Settings | File Templates.
 */
public class JSONUtil {
    public static String getFromJSONStr(String jsonStr, String property) {
        String result = "";
        JSONArray jsonArray = JSONArray.fromObject(jsonStr);
        for (Object aJsonArray : jsonArray) {
            JSONObject jsonObject = (JSONObject) aJsonArray;
            result = jsonObject.get(property).toString();
        }
        return result;
    }
}
